<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>员工列表页</title>
</head>
<body>
	
	<a href="addemp.jsp">添加新员工</a><br>
	<!-- 查询的表单 end -->
	<from action="EmpServlet?method=getEmpList" method="post">
	 姓名：<input type="text" name="name" />
          <input type="submit" value="查询" />
	</from>
	<c:if test="${empty list }">还没有员工信息。。。</c:if>
	<c:if test="${not empty list }">
		<table border="1" cellpadding="0" cellspacing="0">
			<tr>
				<td>编号</td>
				<td>名字</td>
				<td>性别</td>
				<td>工资</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${list }" var="obj">
				<tr>
					<td>${obj.id }</td>
					<td>${obj.name }</td>
					<td>${obj.sex }</td>
					<td>${obj.sal }</td>
					<td><a href="EmpServlet?method=getEmpById&id=${obj.id }">查看</a>
					 <a href="EmpServlet?method=getEmpById&id=${obj.id }"> 删除</a></td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
</body>
</html>